﻿@model ViewModel_AddQuestion;
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加新试题</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    @if (TempData["Message"] != null)
    {
        <script>alert('@Html.Raw(TempData["Message"])');</script>
    }

    <div class="container mt-5">
        <div class="row">
            <div class="col-md-8 offset-md-2">
                <div class="card">
                    <div class="card-header bg-primary text-white">
                        添加知识点
                    </div>
                    <div class="card-body">
                        <form asp-controller="Questions" asp-action="AddSumbitQuestion">
                            <div class="form-group">
                                <label for="question_type">试题类型</label>
                                <select class="form-control" name="question_type" required>
                                    <option value="">请选择试题类型</option>
                                    @foreach(var s in Model.questionType)
                                    {
                                        <option value="@s.qt_id">@s.type_name</option>
                                    }
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="question_difficulty">难度</label>
                                <select class="form-control" name="question_difficulty" required>
                                    <option value="">请选择难度</option>
                                    <option value="简单">简单</option>
                                    <option value="中等">中等</option>
                                    <option value="困难">困难</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="question_difficulty">知识点</label>
                                <select class="form-control" name="kp_id" required>
                                    <option value="">请选择知识点</option>
                                    @foreach(var s in Model.knowledges)
                                    {
                                        <option value="@s.pk_id">@s.pk_name</option>
                                    }
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="question_content">题目</label>
                                <textarea class="form-control"  rows="14" placeholder="请输入题目" name="question_content" required></textarea>
                            </div>
                            <div class="form-group">
                                <label for="answer">答案</label>
                                <textarea class="form-control"  rows="14" placeholder="请输入答案" name="answer" required></textarea>
                            </div>
                            
                            
                            <div class="text-center">
                                <input type="submit" value="提交" class="btn btn-primary" />
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
